SELECT DB_NAME(dbius.[database_id]) AS [Database],
OBJECT_NAME(dbius.[object_id]) AS [TableName],
MAX(dbius.[last_user_lookup]) AS [last_user_lookup],
MAX(dbius.[last_user_scan]) AS [last_user_scan],
MAX(dbius.[last_user_seek]) AS [last_user_seek],
MAX(dbius.[last_user_update]) AS [last_user_seek]
FROM sys.dm_db_index_usage_stats AS dbius
WHERE dbius.[database_id] = DB_ID() AND dbius.[object_id] = OBJECT_ID('YourTableName')
GROUP BY dbius.[database_id], dbius.[object_id]
اطلاعات آخرین دسترسی به جدول در SQL SERVER
سید حامد واحدی
19 مهر 1398